Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow flymake-ruff to use Ruff config files from remote TRAMP hosts #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

struan-robertson
Copy link

@struan-robertson struan-robertson commented Dec 28, 2024

flymake-ruff uses a local Ruff executable when checking a remote TRAMP file, which is preferable as the code checked is confined to the buffer and running commands over TRAMP can be slow. However, flymake-ruff tries to pass the full TRAMP path (i.e. /ssh:remote:/path/to/pyproject.toml) to Ruff as the config file location. This pull request copies the remote config file to /tmp on the local machine so that it can be passed to the Ruff executable. To stop TRAMP slowing to a crawl and prevent reentrant errors, the config is cached in tmp and can be refreshed by reverting the buffer.

@struan-robertson struan-robertson marked this pull request as draft December 28, 2024 17:34
Don't pollute /tmp

Fix error on directory existing

Cache config and use tramp-handle-* funcitons to stop TRAMP reentrant errors
@struan-robertson struan-robertson marked this pull request as ready for review December 28, 2024 23:17
@erickgnavar
Copy link
Owner

Hi, thanks for your contribution, I'll have to do some tests before merging this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants